
import java.applet.AudioClip;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

THIS CODE WILL NO LONGER RUN BUT HAS HAD CHANGES WHICH ARE CLEARLY VISIBLE IN GOOGLE
        setLayout(new BorderLayout());
        panel.add(first);
        panel.add(previous);
        panel.add(next);
        panel.add(last);
        
        add(panel, BorderLayout.SOUTH);
        
        for (int i=0; i < 5; i++) 
        {
            pictures[i] = getImage(getCodeBase(), "../../images/" + i + ".jpg");
        }
        setSize(500, 500);
    }
    
    public void paint(Graphics g) 
    {
        super.paint(g);
        g.drawImage(pictures[current], 10, 10, this);
    }

    @Override
    public void actionPerformed(ActionEvent e) 
    {
        if(e.getSource() == first)
        {
            if(current != 0)
            {
                current = 0;
                sound.play();
                repaint();
            }
        }
        else if(e.getSource() == previous)
        {
            if(current != 0)
            {
                current--;
                sound.play();
                repaint();
            }
        }
        else if(e.getSource() == next)
        {
            if(current != 4)
            {
                current++;
                sound.play();
                repaint();
            }
        }
        else if(e.getSource() == last)
        {
            if(current != 4)
            {
                current = 4;
                sound.play();
                repaint();
            }
        }
    }
    
    
}
